﻿using System;
using System.Xml.Serialization;
using Pospa.NET.WebPageTestApi.Interfaces;

namespace Pospa.NET.WebPageTestApi.DataObjects
{
	[Serializable]
	[XmlRoot("response")]
	public class TestResponse : BaseTestResponse, ITestResponse
	{
		[XmlIgnore]
		public string TestId
		{
			get { return Data.TestId; }
		}

		[XmlIgnore]
		public string XmlUrl
		{
			get { return Data.XmlUrl; }
		}

		[XmlIgnore]
		public string UserUrl
		{
			get { return Data.UserUrl; }
		}

		[XmlIgnore]
		public string SummaryCsv
		{
			get { return Data.SummaryCsv; }
		}

		[XmlIgnore]
		public string DetailCsv
		{
			get { return Data.DetailCsv; }
		}

		[XmlElement("data")]
		public TestResponseData Data { get; set; }
	}

	[Serializable]
	[XmlRoot("data")]
	public class TestResponseData
	{
		[XmlElement("testId")]
		public string TestId { get; set; }

		[XmlElement("xmlUrl")]
		public string XmlUrl { get; set; }

		[XmlElement("userUrl")]
		public string UserUrl { get; set; }

		[XmlElement("summaryCSV")]
		public string SummaryCsv { get; set; }

		[XmlElement("detailCSV")]
		public string DetailCsv { get; set; }
	}
}